package jp.sourceforge.akjrcp.akj_betas;

import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.swt.widgets.Composite;

public class PreferenceUtils {
	public static final int RATE_8000=8000;
	public static final int RATE_11025=11025;
	public static final int RATE_12000=12000;
	public static final int RATE_16000=16000;
	public static final int RATE_22050=22050;
	public static final int RATE_24000=24000;
	public static final int RATE_32000=32000;
	public static final int RATE_44100=44100;
	public static final int RATE_48000=48000;
	
	public static FieldEditor createAudioRateFieldEditor(String key,String label,Composite parent){
		FieldEditor field=new RadioGroupFieldEditor(
		        key,
				label, // //$NON-NLS-1$
				4,
				new String[][] { { RATE_8000+" khz", RATE_8000+"" }, { //$NON-NLS-1$ //$NON-NLS-2$
					RATE_11025+" khz", RATE_11025+""   //$NON-NLS-1$ //$NON-NLS-2$
				    
				},
				{ RATE_12000+" khz", RATE_12000+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				{ RATE_16000+" khz", RATE_16000+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				{ RATE_22050+" khz", RATE_22050+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				
				{ RATE_32000+" khz", RATE_32000+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				{ RATE_44100+" khz", RATE_44100+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				{ RATE_48000+" khz", RATE_48000+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				
			}, parent);
		return field;
	}
	
	public static FieldEditor createAudioChannelFieldEditor(String key,String label,Composite parent){
		FieldEditor field=new RadioGroupFieldEditor(
		        key,
				label, // //$NON-NLS-1$
				4,
				new String[][] { { Messages.getString("stereo"), "2" }, {Messages.getString("monoral") ,"1"}
			}, parent);
		return field;
	}
	

	public static FieldEditor createFLVAudioRateFieldEditor(String key,String label,Composite parent){
		FieldEditor field=new RadioGroupFieldEditor(
		        key,
				label, // //$NON-NLS-1$
				4,
				new String[][] {  
		        		{RATE_11025+" khz", RATE_11025+""},//$NON-NLS-1$ //$NON-NLS-2$
				{ RATE_22050+" khz", RATE_22050+"" }, //$NON-NLS-1$ //$NON-NLS-2$
				
				{ RATE_44100+" khz", RATE_44100+"" }, //$NON-NLS-1$ //$NON-NLS-2$

				
			}, parent);
		return field;
	}
	
}
